import React, {ReactNode} from "react";
import {MyButton} from '@/components'
import './search-panel.scss'

interface ISearchPanelProps {
    children: ReactNode,
    resetName?: string,
    searchClick: () => void,
    resetClick: () => void
}

const SearchPanel: React.FC<ISearchPanelProps> = ({children, resetName = '重置', searchClick, resetClick}) => {
    return <div className="search-panel">
        <div className='content'>
            <div className="searchSlot">

                {children}
            </div>
            <div className='button-list'>
                <MyButton text='搜索' onClick={() => {
                    searchClick()
                }}></MyButton>
                <MyButton text={resetName} onClick={() => {
                    resetClick()
                }}></MyButton>
            </div>
        </div>
    </div>
}

export default SearchPanel
